/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package se_juegos;

import Inference.Configuracion;
import Inference.Constants;
import Inference.OntologyAccess;
import java.awt.Dialog;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JLabel;

/**
 *
 * @author FERNANDO MORENO
 */
public class EscogerJuegos extends javax.swing.JFrame {
    private String currentGame;
    private String currentGameName;
    private boolean currentPlayed;
    private boolean currentBuyed;
    public static JDialog dialog;
    public static Resultados resultados;
    /**
     * Creates new form EscogerJuegos
     * @throws java.lang.Exception
     */
    public EscogerJuegos() throws Exception {
        initComponents();
        this.lboxBuyed.setModel(new DefaultListModel());
        this.lboxPlayed.setModel(new DefaultListModel());
        this.pnlGameInfo.setVisible(false);
        List<String> juegos = OntologyAccess.getJuegos();
        juegos.sort(new Comparator<String>(){
            @Override
            public int compare(String s1, String s2) {
                return s1.compareTo(s2); 
            }
        });
        this.cboGameList.removeAllItems();
        for (String juego : juegos) {
            this.cboGameList.addItem(juego);
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        calificacion = new javax.swing.ButtonGroup();
        cboGameList = new javax.swing.JComboBox();
        btnSearch = new javax.swing.JButton();
        pnlGameInfo = new javax.swing.JPanel();
        lblGameName = new javax.swing.JLabel();
        chkGamePlayed = new javax.swing.JCheckBox();
        chkGameBuyed = new javax.swing.JCheckBox();
        btnSave = new javax.swing.JButton();
        lblImagen = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        calificacion1 = new javax.swing.JRadioButton();
        calificacion2 = new javax.swing.JRadioButton();
        calificacion3 = new javax.swing.JRadioButton();
        calificacion4 = new javax.swing.JRadioButton();
        calificacion5 = new javax.swing.JRadioButton();
        jLabel4 = new javax.swing.JLabel();
        lblGusto = new javax.swing.JLabel();
        btnRecommend = new javax.swing.JButton();
        lblBuyedList = new javax.swing.JLabel();
        lblPlayedList = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        lboxPlayed = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        lboxBuyed = new javax.swing.JList();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        cboGameList.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        btnSearch.setText("Buscar");
        btnSearch.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnSearchMouseClicked(evt);
            }
        });

        pnlGameInfo.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        lblGameName.setText("Nombre");

        chkGamePlayed.setText("Jugado");

        chkGameBuyed.setText("Comprado");

        btnSave.setText("Guardar");
        btnSave.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnSaveMouseClicked(evt);
            }
        });

        lblImagen.setText("Imagen");

        jLabel2.setText("Este juego lo he...");

        jLabel3.setText("Luego de guardar puedes elegir mas juegos");

        calificacion.add(calificacion1);
        calificacion1.setLabel("1");
        calificacion1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                calificacionMouseClicked(evt);
            }
        });

        calificacion.add(calificacion2);
        calificacion2.setText("2");
        calificacion2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                calificacionMouseClicked(evt);
            }
        });

        calificacion.add(calificacion3);
        calificacion3.setText("3");
        calificacion3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                calificacionMouseClicked(evt);
            }
        });

        calificacion.add(calificacion4);
        calificacion4.setText("4");
        calificacion4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                calificacionMouseClicked(evt);
            }
        });

        calificacion.add(calificacion5);
        calificacion5.setText("5");
        calificacion5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                calificacionMouseClicked(evt);
            }
        });

        jLabel4.setText("Ponle un puntaje a este juego");

        lblGusto.setText("  ");

        javax.swing.GroupLayout pnlGameInfoLayout = new javax.swing.GroupLayout(pnlGameInfo);
        pnlGameInfo.setLayout(pnlGameInfoLayout);
        pnlGameInfoLayout.setHorizontalGroup(
            pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlGameInfoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlGameInfoLayout.createSequentialGroup()
                        .addGap(0, 164, Short.MAX_VALUE)
                        .addComponent(btnSave))
                    .addGroup(pnlGameInfoLayout.createSequentialGroup()
                        .addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4)
                            .addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlGameInfoLayout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblGameName)
                                    .addGap(70, 70, 70))
                                .addGroup(pnlGameInfoLayout.createSequentialGroup()
                                    .addComponent(lblImagen, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jLabel2)
                                        .addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(chkGameBuyed)
                                            .addComponent(chkGamePlayed))))))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
            .addGroup(pnlGameInfoLayout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblGusto)
                    .addGroup(pnlGameInfoLayout.createSequentialGroup()
                        .addComponent(calificacion1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(calificacion2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(calificacion3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(calificacion4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(calificacion5)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlGameInfoLayout.setVerticalGroup(
            pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlGameInfoLayout.createSequentialGroup()
                .addComponent(lblGameName)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlGameInfoLayout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(9, 9, 9)
                        .addComponent(chkGamePlayed)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(chkGameBuyed))
                    .addComponent(lblImagen, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(2, 2, 2)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(calificacion1)
                    .addComponent(calificacion2)
                    .addComponent(calificacion3)
                    .addComponent(calificacion4)
                    .addComponent(calificacion5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblGusto)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnSave)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        btnRecommend.setText("Recomendar!");
        btnRecommend.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnRecommendMouseClicked(evt);
            }
        });

        lblBuyedList.setText("Comprados");

        lblPlayedList.setText("Jugados");

        lboxPlayed.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane1.setViewportView(lboxPlayed);

        lboxBuyed.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane2.setViewportView(lboxBuyed);

        jLabel1.setText("Selecciona un juego y has click en Buscar");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(cboGameList, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnSearch)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblBuyedList)
                            .addComponent(lblPlayedList)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(6, 6, 6)
                        .addComponent(pnlGameInfo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnRecommend)
                .addGap(110, 110, 110))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cboGameList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSearch))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(lblBuyedList)
                        .addGap(3, 3, 3)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblPlayedList)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(pnlGameInfo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnRecommend)
                .addContainerGap())
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void btnSearchMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSearchMouseClicked
        this.currentGame = this.cboGameList.getSelectedItem().toString();
        List<String> nombres = OntologyAccess.getPropiedadesJuegosData(currentGame, Constants.PROPIEDAD_NOMBRE);
        this.currentGameName = nombres.size() > 0 ? nombres.get(0):""; 
        this.pnlGameInfo.setVisible(true);
        ArrayList<String> jugados = SE_juegos.motor.getJuegosJugados();
        ArrayList<String> comprados = SE_juegos.motor.getJuegosComprados();
        if(jugados.contains(this.currentGame)){
            this.chkGamePlayed.setSelected(true);
            this.currentPlayed = true;
        }
        else{
            this.chkGamePlayed.setSelected(false);
            this.currentPlayed = false;
        }
        if(comprados.contains(this.currentGame)){
            this.chkGameBuyed.setSelected(true);
            this.currentBuyed = true;
        }
        else{
            this.chkGameBuyed.setSelected(false);
            this.currentBuyed = false;
        }
        this.lblGameName.setText(this.currentGameName);
        if(!Configuracion.offline){
            List<String> imagenes = OntologyAccess.getPropiedadesJuegosData(this.currentGame, Constants.PROPIEDAD_URL_IMAGEN);
            String imgURL = imagenes.size() > 0 ? imagenes.get(0):"http://cdn.akamai.steamstatic.com/steam/apps/7670/header_292x136.jpg?t=1392365692";
            Image gameImage = null;
            try {
                URL url = new URL(imgURL);
                BufferedImage image = ImageIO.read(url);
                gameImage = image.getScaledInstance(this.lblImagen.getWidth(), this.lblImagen.getHeight(),Image.SCALE_SMOOTH);
            } catch (IOException e) {
                    e.printStackTrace();

            }
            this.lblImagen.setIcon(new ImageIcon(gameImage));
        }else{
            this.lblImagen.setText("No se puede mostrar la imagen");
        }
    }//GEN-LAST:event_btnSearchMouseClicked

    private void btnRecommendMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnRecommendMouseClicked
        
        try {
            EscogerConsolas ventanaConsolas = new EscogerConsolas();
            dialog = new JDialog();
            dialog.add(ventanaConsolas);
            dialog.pack();
            dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
            dialog.setVisible(true);
            SE_juegos.motor.obtenerSugerencias();
            resultados = new Resultados();
            resultados.setVisible(true);
            //cargar aqui nueva pantalla de resultados
        } catch (Exception ex) {
            Logger.getLogger(EscogerJuegos.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }//GEN-LAST:event_btnRecommendMouseClicked

    private void btnSaveMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSaveMouseClicked
        boolean buyed = this.chkGameBuyed.isSelected();
        boolean played = this.chkGamePlayed.isSelected();
        DefaultListModel buyedList = (DefaultListModel) this.lboxBuyed.getModel();
        DefaultListModel playedList = (DefaultListModel) this.lboxPlayed.getModel();
        int cal =0;
        if(this.calificacion1.isSelected())cal = 1;
        if(this.calificacion2.isSelected())cal = 2;
        if(this.calificacion3.isSelected())cal = 3;
        if(this.calificacion4.isSelected())cal = 4;
        if(this.calificacion5.isSelected())cal = 5;
        if(buyed != this.currentBuyed){
            if(buyed){
                SE_juegos.motor.ingresarJuegoComprado(currentGame);   
                buyedList.addElement(currentGameName);
                this.currentBuyed = true;
            }
            else{
                SE_juegos.motor.removerJuegoComprado(currentGame);
                buyedList.removeElement(currentGameName);
                this.currentBuyed = false;
            }
        }
        if(played != this.currentPlayed){
            if(played){
                SE_juegos.motor.ingresarJuegoJugado(currentGame,cal);
                playedList.addElement(currentGameName);
                this.currentPlayed = true;
            }
            else{
                SE_juegos.motor.removerJuegoJugado(currentGame);
                playedList.removeElement(currentGameName);
                this.currentPlayed = false;
            }
        }
        //this.pnlGameInfo.setVisible(false);
    }//GEN-LAST:event_btnSaveMouseClicked

    private void calificacionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_calificacionMouseClicked
        // TODO add your handling code here:
        if(this.calificacion1.isSelected())this.lblGusto.setText("No me gustó para nada");
        if(this.calificacion2.isSelected())this.lblGusto.setText("No me gustó");
        if(this.calificacion3.isSelected())this.lblGusto.setText("No me gustó ni me disgustó");
        if(this.calificacion4.isSelected())this.lblGusto.setText("Me gustó");
        if(this.calificacion5.isSelected())this.lblGusto.setText("Me encantó");
    }//GEN-LAST:event_calificacionMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(EscogerJuegos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    new EscogerJuegos().setVisible(true);
                } catch (Exception ex) {
                    Logger.getLogger(EscogerJuegos.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnRecommend;
    private javax.swing.JButton btnSave;
    private javax.swing.JButton btnSearch;
    private javax.swing.ButtonGroup calificacion;
    private javax.swing.JRadioButton calificacion1;
    private javax.swing.JRadioButton calificacion2;
    private javax.swing.JRadioButton calificacion3;
    private javax.swing.JRadioButton calificacion4;
    private javax.swing.JRadioButton calificacion5;
    private javax.swing.JComboBox cboGameList;
    private javax.swing.JCheckBox chkGameBuyed;
    private javax.swing.JCheckBox chkGamePlayed;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel lblBuyedList;
    private javax.swing.JLabel lblGameName;
    private javax.swing.JLabel lblGusto;
    private javax.swing.JLabel lblImagen;
    private javax.swing.JLabel lblPlayedList;
    private javax.swing.JList lboxBuyed;
    private javax.swing.JList lboxPlayed;
    private javax.swing.JPanel pnlGameInfo;
    // End of variables declaration//GEN-END:variables
}
